#ifndef FILE_H
#define FILE_H

#include "portio.h"

class FileCB
{
	public:
		FileCB() { }
		virtual ~FileCB() { }

		virtual void fileIn(int32 Amt) = 0;
		virtual void fileEOF() = 0;
		virtual void fileErr(uint32 Err) = 0;
};

class File : public PortUser
{
	public:
		File(FileCB*);
		~File();

		bool8 open(const String& Filename);
		void close();

		void read(uint8* Buf, int32 Amt);

		uint32 getSize();

		bool8 seek(int32 position);
	protected:
		void ioDone(DWORD);
		void ioErr(DWORD);

	protected:
		FileCB* cb;
};

#endif
